var rtpth=location.href.match(/(http:\/\/.*?\/)index\.php/)[1];

function createXMLRequest()
{
if(window.XMLHttpRequest)
{
return new XMLHttpRequest();
}
else if(window.ActiveXObject)
{
try
{
return new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try
{
return new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e)
{
return false;
}
}
}
}

function qdf(fid,tid,pid,auth)
{
if(!confirm('Are you sure you wish to delete this post?'))return;
var thd=createXMLRequest();
thd.open('GET',rtpth+'index.php?act=Mod&CODE=04&f='+fid+'&t='+tid+'&p='+pid+'&auth_key='+auth,true);
thd.onreadystatechange = function(){if(thd.readyState==4){
var c=thd.responseText;
if(c.match(/The error returned was/))
{
window.location='index.php?act=Mod&CODE=04&f='+fid+'&t='+tid+'&p='+pid+'&auth_key='+auth
}
else
{
var ent=null;
var lnks=document.anchors;
for(var i=0;i<lnks.length;i++)
{
if(lnks[i].getAttribute('name')=='entry'+pid)
{
ent=lnks[i];
break
}
}
pt=ent.nextSibling;
if(pt.nodeType!=1)pt=pt.nextSibling;
pt.style.display='none';
pt=pt.nextSibling;
if(pt.nodeType!=1)pt=pt.nextSibling;
pt.style.display='none';
return
}
}};
thd.send(null);
}

function qdsetup()
{
if(!createXMLRequest)return;
if(!document.getElementById)return;
var lnks=document.links;
for(var i=0;i<lnks.length;i++)
{
if(lnks[i].href.match(/javascript:delete_post/))
{
var fid=lnks[i].href.match(/f=([0-9]+)/)[1];
var tid=lnks[i].href.match(/t=([0-9]+)/)[1];
var pid=lnks[i].href.match(/p=([0-9]+)/)[1];
var auth=lnks[i].href.match(/auth_key=([a-z0-9]+)/)[1];
lnks[i].href="javascript:qdf("+fid+","+tid+","+pid+",'"+auth+"')";
}
}
}

qdsetup()